//
// Created by Lenovo on 2020/10/25.
//

#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <algorithm>
#define debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
const int maxn = 1e7+10;
bool vis[maxn];
int prime[maxn];
const int N= 2e5+10;
int a[N];
int D[N];
int init()
{
    int cnt = 0;
    for(int i = 2;i<maxn;i++)
    {
        if(!vis[i])
        {
            prime[++cnt] = i;
            //debug(prime[cnt]);
            for(int j = 2;i*j<maxn;j++) vis[i*j] = true;
        }
    }
    return cnt;
}
int pos[maxn];
map<int,int>num;
int main()
{
   // int k = init();
    int n,x,cnt;
    int maxx = 0;
    cnt = 0;
    cin>>n;
    for(int i = 1;i<=n;i++)
    {
        cin>>x;
        maxx = max(maxx,x);
        num[x]++;
        if(num[x]==1) a[++cnt] = x;
    }
    memset(D,0,sizeof(D));
    sort(a+1,a+1+cnt);
    for(int i = 1;i<=cnt;i++)
    {
        pos[a[i]] = i;
    }
    int ans = 0;
    for(int i = 1;i<=cnt;i++)
    {
        D[i] = num[a[i]];
        for(int j = 1;*a[i]<=maxx;j++)
        {
            if(num[prime[j]*a[i]])
            {
                num[prime[j]*a[i]] += num[a[i]];
            }
        }
        ans = max(ans,D[i]);
    }
    cout<<ans<<endl;
}